package com.bright.tactiviti.base;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


public class BaseServiceImpl<M extends BaseMapper<T>,T extends BaseEntity> extends ServiceImpl<M,T> implements BaseService<T> {
    @Override
    public void saveEntity(T entity) throws Exception {
        save(entity);
    }

    @Override
    public void editEntity(T entity) throws Exception {
        updateById(entity);
    }

    @Override
    public T get(String id) {
        return baseMapper.selectOne(new LambdaQueryWrapper<T>().eq(T::getId,id));
    }
}
